import request from '@/utils/http'
import { BaseResult } from '@/types/axios'

export class UserService {
  // 获取套餐列表
  static getComboList(params: object) {
    return request.get<BaseResult>({
      url: '/user/user/combo/list',
      params
    })
  }

  // 获取套餐总计
  static getComboTotal() {
    return request.get<BaseResult>({
      url: '/user/user/combo/total'
    })
  }
  //获取子账号列表
  static getSubUserPage(params: object) {
    return request.get<BaseResult>({
      url: '/user/sub_user/page',
      params
    })
  }
  // 创建子账号
  static subUserCreate(params: object) {
    return request.post<BaseResult>({
      url: '/user/sub_user/create',
      data: params
    })
  }
  // 更新子账号
  static subUserUpdate(params: object) {
    return request.post<BaseResult>({
      url: '/user/sub_user/update',
      data: params
    })
  }
  // 删除子账号
  static subUserDelete(params: object) {
    return request.post<BaseResult>({
      url: '/user/sub_user/delete',
      data: params
    })
  }
  // 停用子账号
  static subUserDisable(params: object) {
    return request.post<BaseResult>({
      url: '/user/sub_user/disable',
      data: params
    })
  }
  // 启用子账号
  static subUserEnable(params: object) {
    return request.post<BaseResult>({
      url: '/user/sub_user/enable',
      data: params
    })
  }
  // 获取用户信息
  static getUserInfo() {
    return request.get<BaseResult>({
      url:'/user/user/info'
    })
  }
}
